{svc?.name ?? 'Status'} — YAUM
{#if !svc}

Serviço não encontrado

← Voltar ao início

{:else}
← Voltar ao Dashboard
{#if isUp === null}

Aguardando verificação

{:else}
{#if isUp} {:else} {/if}

{isUp ? 'Operando Normalmente' : 'Fora do Ar'}

{/if}

{svc.name}

{svc.url}

{#if stats}

SLA 30 dias

{stats.uptime_30d.toFixed(2)}%

Latência Média

{stats.avg_response_ms_30d.toFixed(0)}ms

Total de Checks

{stats.total_checks_30d}

{/if}
{#if stats}

Uptime

{#each [ { label: 'Últimas 24h', uptime: stats.uptime_24h, checks: stats.total_checks_24h, avg: stats.avg_response_ms_24h }, { label: 'Últimos 7 dias', uptime: stats.uptime_7d, checks: stats.total_checks_7d, avg: stats.avg_response_ms_7d }, { label: 'Últimos 30 dias', uptime: stats.uptime_30d, checks: stats.total_checks_30d, avg: stats.avg_response_ms_30d } ] as item}
{item.label} {item.checks} checks
{item.uptime.toFixed(2)}% {item.avg.toFixed(0)}ms méd.
{/each}
{/if}

Tempo de Resposta (ms)

{#if history.length === 0}
Sem dados ainda
{:else if history.length === 1}
{history[0].response_time_ms} ms {history[0].is_up ? 'Online' : 'Offline'} — {history[0].status_code || 'timeout'}
{:else} {#each yTicks as tick} {tick.val} {/each} `${d.x},${d.y}`).join(' ')} fill="none" stroke="var(--green)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> {#each dots as d} {/each} {/if}
{history[0]?.tested_at ? new Date(history[0].tested_at).toLocaleTimeString() : ''} {history[history.length - 1]?.tested_at ? new Date(history[history.length - 1].tested_at).toLocaleTimeString() : ''}

Histórico de Verificações

{#if history.length === 0}

Nenhuma verificação registrada

{:else}
{#each [...history].reverse() as h} {/each}
Horário Status Código Latência Erro
{new Date(h.tested_at).toLocaleString('pt-BR')} {h.is_up ? 'UP' : 'DOWN'} {h.status_code > 0 ? h.status_code : '—'} {h.response_time_ms}ms {#if h.error_message} {#if expandedError === h.id}
{(h as any).error_message}
{/if} {:else} — {/if}
{/if}
{/if}